﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SceneFrame
{
    public class FilterFunc : IFilter
    {
        Func<Trigger, Scene, bool> _Func = null;

        public FilterFunc(Func<Trigger, Scene, bool> func)
        {
            _Func = func;
        }

        public override bool Filter(Trigger trigger)
        {
            return _Func(trigger, Scene);
        }
    }

    public static class FilterFuncEx
    {
        public static void AddFunc(this List<IFilter> _list, Func<Trigger, Scene, bool> func)
        {
            _list.Add(new FilterFunc(func));
        }
    }
}
